<%--
  Created by IntelliJ IDEA.
  User: qiliping
  Date: 16/4/9
  Time: 下午7:14
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<%@ taglib prefix="fmt" uri="http://java.sun.com/jsp/jstl/fmt" %>
<%@ taglib prefix="paging" uri="paging-taglib" %>
<%@ taglib prefix="form" uri="http://www.springframework.org/tags/form" %>
<c:set var="ctx" value="${pageContext.request.contextPath}"/>
<html>
<head>
    <title>开放购买</title>
  <%--  <script>
        $(function(){
            $("form").submit(function(){
               var openDate = $("#openDate").val();
                if(openDate==''){
                    alert('请填写开放日');
                    return false;
                }
                return true;
            });
        })
    </script>--%>
</head>
<body>
<div class="row">
    <div class="col-md-12">
        <!-- BEGIN PAGE TITLE & BREADCRUMB-->
        <h3 class="page-title">
            基金管理
            <small>基金列表</small>
        </h3>
        <ul class="page-breadcrumb breadcrumb">
            <li>
                <i class="fa fa-home"></i>
                <a href="${ctx}/main">
                    首页
                </a>
                <i class="fa fa-angle-right"></i>
            </li>
            <li>
                <a href="${ctx}/product">
                    基金管理
                </a>
                <i class="fa fa-angle-right"></i>
            </li>
            <li>
                <a href="#">
                    开放购买
                </a>
            </li>
        </ul>
        <!-- END PAGE TITLE & BREADCRUMB-->
    </div>
</div>

<div class="main">

    <div class="row">
        <div class="col-md-12">
            <div class="panel panel-primary">

                <div class="panel-body height410">
                    <div class="form-group">
                        <label class="control-label">基金名称：</label>
                        <span>${product.productName}</span>
                    </div>
                    <div class="form-group">
                        <label class="control-label">基金管理人：</label>
                        <span>${product.fundCompanyName }</span>
                    </div>
                    <div class="form-group">
                        <label class="control-label">基金经理 ：</label>
                        <span>${product.fundManagerName}</span>
                    </div>
                    <div class="form-group">
                        <label class="control-label">托管银行：</label>
                        <span>${product.fundCustodianName}</span>
                    </div>
                    <div class="form-group">
                        <label class="control-label">券商：</label>
                        <span>${product.fundTradingBroker}</span>
                    </div>
                    <div class="form-group">
                        <label class="control-label pull-left">总规模：</label>
                        <span style="margin-left: 75px;display: block;" class="trunk-fill4">
                            <fmt:formatNumber value="${product.productTotalScale}" pattern=",000"></fmt:formatNumber>万元
                        </span>
                    </div>
                    <div class="form-group">
                        <label class="control-label pull-left">成立时间：</label>
                        <span>
                            <fmt:formatDate value="${product.registerDate}" pattern="yyyy-MM-dd"/>

                        </span>
                    </div>
                    <div class="form-group">
                        <label class="control-label pull-left">已募集：</label>
                        <span>
                            <fmt:formatNumber value="${product.hasInvestAmount}" pattern=",000"></fmt:formatNumber>万元

                        </span>
                    </div>
                    <div class="form-group">
                        <label class="control-label pull-left">状态：</label>
                        <span>
                            <c:choose>
                                <c:when test="${product.productStatus == 3}">
                                    预约中
                                </c:when>
                                <c:when test="${product.productStatus == 4}">
                                    募集中
                                </c:when>
                                <c:when test="${product.productStatus == 8}">
                                    运行中
                                </c:when>
                                <c:when test="${product.productStatus == 9}">
                                    已结束
                                </c:when>
                            </c:choose>

                        </span>
                    </div>
                </div>
            </div>

        </div>
    </div>
<c:if test="${product.productStatus==8&&product.isOpenSale==0}">
    <div class="row">
        <div class="col-md-12">
            <form:form method="post" modelAttribute="OpenSaleModel" class="form-horizontal">
                <form:hidden path="productId"></form:hidden>

                <div class="form-group">
                    <label class="control-label col-md-3">基金净值：</label>
                    <div class="col-md-3">
                        <div class="input-group">
                            <form:input path="netvalue" cssClass="form-control" maxlength="4" placeholder=""></form:input>

                        </div>
                    </div>
                    <form:errors path="netvalue" cssClass="field-validation-error" element="div"></form:errors>
                </div>
                <div class="form-group">
                    <label class="control-label col-md-3">净值计算日期：</label>
                    <div class="col-md-4">
                        <div class="input-daterange input-group">
                            <form:input path="clacDate" cssClass="form-control fromdatetime col-md-4" maxlength="10" placeholder=""></form:input>
                        </div>
                    </div>
                    <form:errors path="clacDate" cssClass="field-validation-error" element="div"></form:errors>
                </div>

                <div class="form-group">
                    <label class="control-label col-md-3">开放购买日期：</label>
                    <div class="col-md-4">
                        <div class="input-daterange input-group">
                            <form:input path="openDate" cssClass="form-control fromdatetime col-md-4" maxlength="10" placeholder=""></form:input>
                           </div>
                    </div>
                    <form:errors path="openDate" cssClass="field-validation-error" element="div"></form:errors>
                </div>
                <div class="form-group">
                    <div class="col-md-9 col-md-offset-3">
                        <button type="submit" class="btn blue">开放购买</button>
                        <span class="field-validation-error">${error}</span>
                    </div>
                </div>
            </form:form>
        </div>
    </div>
</c:if>
    <c:if test="${product.productStatus==8&&product.isOpenSale==1}">
    <div class="row">
        <div class="col-md-12">
            <form:form method="post" modelAttribute="OpenSaleModel" class="form-horizontal">
                <form:hidden path="productId"></form:hidden>
                <form:hidden path="netvalue"></form:hidden>
                <form:hidden path="openDate"></form:hidden>
                <div class="form-group">
                    <div class="col-md-9 col-md-offset-3">
                        <button type="submit" class="btn blue">投入运行</button>
                        <span class="field-validation-error">${error}</span>
                    </div>
                </div>
            </form:form>
        </div>
    </div>
    </c:if>
</body>
</html>
